package com.eascs.ticket.ticket.controller;

import java.util.List;

import javax.inject.Inject;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.eascs.site.controller.BaseRestController;
import com.eascs.site.page.PaginationInfo;
import com.eascs.site.view.PaginationRestResult;
import com.eascs.ticket.ticket.form.TicketIdForm;
import com.eascs.ticket.ticket.service.TicketChangeLogService;

@RestController
public class TicketChangeLogRestController extends BaseRestController {

	@Inject
	private TicketChangeLogService ticketChangeLogService;

	@RequestMapping(value = "/ticket/opt/getTicketChangeLogListView")
	public PaginationRestResult getTicketChangeLogListView(TicketIdForm ticketIdForm) {
		List<Object[]> ticketChangeLogs = ticketChangeLogService.getTicketChangeLogsByTicketId(ticketIdForm.getTicketId());
		PaginationInfo paginationInfo = new PaginationInfo(ticketChangeLogs, new String[] { "工单号", "类型", "创建人", "创建时间" });
		paginationInfo.setBuildPagingNavigation(false);
		return PaginationRestResult.buildPaginationRestResult(paginationInfo);
	}
}
